import request from "@/utils/request";

// 用户登录
export function login(data) {
  return request({
    url: "/api/oauth/Login",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    },
    data
  });
}

// 获取当前组织
export function getOrganizeId() {
  return request('/api/permission/Organize/Department/admin/id');
}

// 获取当前用户信息
export function getInfo() {
  return request({
    url: "/api/oauth/CurrentUser",
    method: "get"
  });
}

// 退出登录
export function logout() {
  return request({
    url: "/api/oauth/Logout",
    method: "get"
  });
}

// 锁屏解锁登录
export function unlock(data) {
  return request({
    url: "/api/oauth/LockScreen",
    method: "post",
    data
  });
}

// 查学员用户信息
export const userInfo = data => {
  return request({
    url: "/api/students/Xy_ks_students",
    method: "get",
    data
  });
};

// 获取手机验证码
export const phoneCode = data => {
  return request({
    url: `/v3/telephone/sendsms/${data}`,
    method: "get"
  });
};

// 手机号注册
export const phoneRegister = (data, code) => {
  return request({
    url: `/v3/telephone/register/${code}`,
    method: "post",
    data
  });
};
